package com.byxm.wlgw.service;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import com.byxm.wlgw.bean.GmjlBean;
import com.byxm.wlgw.common.DataBaseAccess;
import com.byxm.wlgw.query.GmjlQuery;

public class GmjlService {
    GmjlQuery gmjlquery=new GmjlQuery();
    String sql=gmjlquery.getGmjlAllSql();
    ResultSet rs=null;
    DataBaseAccess dba=null;
    public List<GmjlBean> getGmjl(){
    	List<GmjlBean> list=new ArrayList<GmjlBean>();
    	try {
			dba=new DataBaseAccess();
			rs=dba.executeQuery(sql);
			while(rs.next()){
				GmjlBean gmpjBean=new GmjlBean();
				gmpjBean.setEmail(rs.getString("email"));
				gmpjBean.setGmsl(rs.getInt("gmsl"));
				list.add(gmpjBean);
			}
			rs.close();
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			try {
				dba.releaseConnect();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
    	return list;
    }
}
